<template>
  <div
    v-auto-resize="options"
    :options="options"
    ref="chart"
    style="width: 90%; height: 100%"
  ></div>
</template>

<script>
import * as echarts from 'echarts'

export default {
  name: 'TemplateEchart',
  props: {
    options: {},
  },

  data() {
    return {
      myeChart: null,
    }
  },

  mounted() {
    // console.log(this.$refs.chart)
    // console.log(this.options)
    this.myeChart = echarts.init(this.$refs.chart)
    this.myeChart.setOption(this.options)
    this.myeChart.on('click', (a) => {
      // console.log(a.name)
    })
  },
  methods: {},
}
</script>

<style scoped></style>
